﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Aprendete.Models
{
    public class MaterialAdicionalRepository
    {
        private DataClasses1DataContext db = new DataClasses1DataContext();

        public void Add(MaterialAdicional MaterialAdicional)
        {
            db.MaterialAdicionals.InsertOnSubmit(MaterialAdicional);
            db.SubmitChanges();
        }

        public void Save()
        {
            db.SubmitChanges();
        }

        public MaterialAdicional GetMateriasImpartidasexid(int id)
        {
            return db.MaterialAdicionals.SingleOrDefault(d => d.MaterialAdicionalID == id);
        }

        public void Delete(MaterialAdicional MaterialAdicional)
        {
            db.MaterialAdicionals.DeleteOnSubmit(MaterialAdicional);
            db.SubmitChanges();
        }

    }
}